package P7.T01;

public class T01 {
    public static void main(String[] args) throws InterruptedException {
        Thread th11=new Thread(new T1(),"张大妈");
        Thread th21=new Thread(new T2(),"李大娘");
        Thread th22=new Thread(new T2(),"李大爷");
        th11.start();
        th21.start();
        th22.start();
    }
}
class T1 implements Runnable{

    @Override
    public void run() {
        for(int i=0;i<20;i++){
            System.out.println(Thread.currentThread().getName()+"在擀皮儿");
            try {
                Thread.sleep(300);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
class T2 implements Runnable{
    @Override
    public void run() {
        for(int i=0;i<20;i++){
            System.out.println(Thread.currentThread().getName()+"在包饺子");
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
